{%extends "base.html"%}
{%block title%}{{username}}{%endblock%}
{%block sideleft%}{%include "sideleft.html"%}{%endblock%}
{%block content%}
<!--登录成功以后的内容-->
<div class="myactivity">
	{%ifnotequal tag '2'%}
		<h3><a href="/activitys/people/{{user.id}}?tag=1" style="font-size:18px;">发布的活动</a>|<a href="/activitys/people/{{user.id}}?tag=2">想去的活动</a></h3>
	{%else%}
		<h3><a href="/activitys/people/{{user.id}}?tag=1">发布的活动</a>|<a href="/activitys/people/{{user.id}}?tag=2" style="font-size:18px;">想去的活动</a></h3>
	{%endifnotequal%}
	{%if ifadd%}
		<span id='add_friends'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='javascript:addFriend()'>加为好友</a></span>
	{%endif%}
	<div class='issued_activity'>
		<ul>
		{%for ia in pages.object_list%}
			{%ifnotequal tag '2'%}
				<li>
					<image src="{{user.profile_image}}" />
				    <div class="issuer_info">
				    	发起&nbsp;<a href="/activity/{{ia.id}}">{{ia.activityname}}</a></br>
						{%ifequal ia.date|date:"Y-m-d" "2008-03-08"%}
							最近
						{%else%}
							{{ia.date|date:"Y-m-d"}}
						{%endifequal%}
						
						
						<span>
							{{ia.datetime|date:"Y-m-d H:m:s"}}&nbsp;&nbsp;
							{%if isme%}
							  <a href='javascript:delacti({{ia.id}})'>删除</a>
							{%else%}
							  <a href='/activity/{{ia.id}}/do'>我要去</a>
							{%endif%}
							
							
						</span>
					</div>
				</li>
			{%else%}
				<li>
					<image src="{{ia.issuer_image}}" />
				    <div class="issuer_info">
				    	{{ia.username}}&nbsp;发起&nbsp;<a href="/activity/{{ia.id}}">{{ia.activityname}}</a></br>
						{%ifequal ia.date|date:"Y-m-d" "2008-03-08"%}
							最近
						{%else%}
							{{ia.date|date:"Y-m-d"}}
						{%endifequal%}
						
						
						<span>
							{{ia.datetime|date:"Y-m-d H:m:s"}}&nbsp;&nbsp;
							{%if isme%}
								<a href="/activity/{{ia.id}}/do_cancel">我不去了</a>
							{%endif%}
						</span>
					</div>
				</li>				
			
			{%endifnotequal%}
		{%endfor%}

		</ul>
		<div class="fenye">
			{%if pages.has_other_pages%}
				{%if pages.has_previous%}
					<a href="?tag={{tag}}&amp;page={{pages.previous_page_number}}">上一页</a>
				{%endif%}
				{%for p in page_range%}
					{%ifequal p pages.number%}
						<span>{{p}}</span>
					{%else%}
						<a href="?tag={{tag}}&amp;page={{p}}">{{p}}</a>
					{%endifequal%}
				{%endfor%}
				{%if pages.has_next%}
					<a href="?tag={{tag}}&amp;page={{pages.next_page_number}}">下一页</a>
				{%endif%}
			{%endif%}
		</div>
	</div>
</div>
	
<div id='addfriend_box'>
	<p>将{{username}}加为好友</p>
    <a href="javascript:void(0)" title="关闭"><div class="close">关闭</div></a> 
   <table border="0" cellpadding="0" >
   	<tr><th></th><td><input type='hidden' id="id_userid" name="userid" value={{userid}} ></td></tr>       
   	{{form.as_table}}        
   </table>	
   <p>请求经对方确认后，即可成为好友</p>
   <a href='javascript:addfriend()'>确定</a>
	</form>
</div>
{%endblock%}
{%block sideright%}{%include "sideright.html"%}{%endblock%}